package com.deer.wms.system.manage.service;

import com.deer.wms.intercept.common.data.CurrentUser;
import com.deer.wms.project.root.core.result.Result;
import com.deer.wms.project.root.service.SuperService;
import com.deer.wms.system.manage.model.organization.Organization;
import com.deer.wms.system.manage.model.organization.OrganizationCriteria;
import com.deer.wms.system.manage.model.organization.OrganizationDto;

import java.util.List;


/**
 * @author guo
 * @since 2019/11/05
 */
public interface OrganizationService extends SuperService<Organization> {

    /**
     * 按照criteria条件查询
     *
     * @param criteria criteria
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findList(OrganizationCriteria criteria);

    /**
     * 按照编码查询
     *
     * @param organizationCode 货主编码
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findByOrganizationCode(String organizationCode);

    /**
     * 根据货主名称查询
     * @param organizationName 货主名称
     * @return List<OrganizationDto>
     */
    List<OrganizationDto> findByOrganizationName(String organizationName);

    /**
     * 新增货主
     * @param organization 货主
     * @param currentUser 当前用户
     * @return Result
     */
    public Result createOrganization(OrganizationDto organization, CurrentUser currentUser);

    /**
     * 按照条件删除
     * @param criteria criteria
     */
    void deleteByCodeAndCom(OrganizationCriteria criteria);

    /**
     * 修改货主状态
     *
     * @param organizationId 用户信息id
     * @param sate           用户信息状态
     * @param currentUser    当前操作人员的信息
     */
    void modifyUserInfoAccountState(Integer organizationId, String sate, CurrentUser currentUser);


    Organization findBy(String organizationCode, String orgCode);
}
